package com.yuxi.Entity;

import java.io.Serializable;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.Table;
import javax.persistence.UniqueConstraint;

/**
 * 用户信息表
 * @author hunter
 * @version 1.0
 *  2016/07/15
 */

@Entity
@Table
public class UserInfo  implements Serializable{
	private int userId;
	private String userName;//用户名
	@Column(length=50)
	private String userPassword;//密码
	@Column(unique = true)
	private String userAccount;//用户工号
	@Column(length=255)
	private String userHeadPortait;//头像	
	private String phone;
	private String idNumber;
	private int createUserid;
	@Column(columnDefinition="text")
	private long createTimg;
	@Column(columnDefinition = "tinyint default 1")
	private boolean enable=true;	

	public boolean isEnable() {
		return enable;
	}

	public void setEnable(boolean enable) {
		this.enable = enable;
	}

	public int getCreateUserid() {
		return createUserid;
	}

	@Id
	@GeneratedValue
	public int getUserId() {
		return userId;
	}
	public void setUserId(int userId) {
		this.userId = userId;
	}
	@Column(length=20)
	public String getUserName() {
		return userName;
	}
	public void setUserName(String userName) {
		this.userName = userName;
	}
	@Column(length=50)
	public String getUserPassword() {
		return userPassword;
	}
	public void setUserPassword(String userPassword) {
		this.userPassword = userPassword;
	}
	@Column(length=20)
	public String getUserAccount() {
		return userAccount;
	}
	public void setUserAccount(String userAccount) {
		this.userAccount = userAccount;
	}
	@Column(length=20)
	public String getUserHeadPortait() {
		return userHeadPortait;
	}
	public void setUserHeadPortait(String userHeadPortait) {
		this.userHeadPortait = userHeadPortait;
	}

	public String getPhone() {
		return phone;
	}

	public void setPhone(String phone) {
		this.phone = phone;
	}

	public String getIdNumber() {
		return idNumber;
	}

	public void setIdNumber(String idNumber) {
		this.idNumber = idNumber;
	}

	public long getCreateTimg() {
		return createTimg;
	}

	public void setCreateTimg(long createTimg) {
		this.createTimg = createTimg;
	}

	public void setCreateUserid(int createUserid) {
		this.createUserid = createUserid;
	}

	
	public UserInfo(int userId, String userName, String userPassword, String userAccount, String userHeadPortait,
			String phone, String idNumber, int createUserid, long createTimg, boolean isEnable) {
		super();
		this.userId = userId;
		this.userName = userName;
		this.userPassword = userPassword;
		this.userAccount = userAccount;
		this.userHeadPortait = userHeadPortait;
		this.phone = phone;
		this.idNumber = idNumber;
		this.createUserid = createUserid;
		this.createTimg = createTimg;
		this.enable = isEnable;
	}

	public UserInfo(int userId, String userName, String userPassword, String userAccount, String userHeadPortait,
			String phone, String idNumber, int createUserid, long createTimg) {
		super();
		this.userId = userId;
		this.userName = userName;
		this.userPassword = userPassword;
		this.userAccount = userAccount;
		this.userHeadPortait = userHeadPortait;
		this.phone = phone;
		this.idNumber = idNumber;
		this.createUserid = createUserid;
		this.createTimg = createTimg;
	}

	public UserInfo() {
		super();
	}

	
	public UserInfo(int userId, String userName) {
		super();
		this.userId = userId;
		this.userName = userName;
	}

	
	public UserInfo(int userId, String userName, String userAccount) {
		super();
		this.userId = userId;
		this.userName = userName;
		this.userAccount = userAccount;
	}

	@Override
	public String toString() {
		return "UserInfo [userId=" + userId + ", userName=" + userName + ", userPassword=" + userPassword
				+ ", userAccount=" + userAccount + ", userHeadPortait=" + userHeadPortait + ", phone=" + phone
				+ ", idNumber=" + idNumber + ", createUserid=" + createUserid + ", createTimg=" + createTimg
				+ ", isEnable=" + enable + "]";
	}

	
	

}
